import * as mars3d from "mars3d"


const tdtCreditHtml = `自然资源部 - <span>审图号：GS(2023)336号</span>
 - 甲测资字1100471 - <a href="https://www.tianditu.gov.cn/about/contact.html?type=2" target="_blank" trace="tos">服务条款</a> `

 const gdCreditHtml = `©2023 高德软件- <span>审图号：GS(2021)6375号</span>
 - 甲测资字11111093 - <a href="https://map.amap.com/doc/serviceitem.html" target="_blank" trace="tos">服务条款</a> `


export const mapOptions = {
  scene: {
    center: { lat: 30.568624, lng: 114.305535, alt: 81473, heading: 0, pitch: -79 },
    highDynamicRange: false,
    fxaa: true,
    requestRenderMode: true // 显式渲染
  },
  // 方式1：在创建地球前的传参中配置 terrain 参数[目前1个球只支持1个地形服务]
  terrain: {
    url: "http://data.mars3d.cn/terrain",
    show: false
  },
  control:{
    // 以下是Cesium.Viewer所支持的控件相关的options
    baseLayerPicker: false, // basemaps底图切换按钮
    homeButton: true, // 视角复位按钮
    sceneModePicker: false, // 二三维切换按钮
    navigationHelpButton: false, // 帮助按钮
    infoBox: false, // 信息框
    selectionIndicator: false, // 选择框
    vrButton: false, // vr模式按钮
    fullscreenButton: false, // 全屏按钮
    animation: false, // 动画部件按钮
    timeline: false, // 时间线

    // 以下是mars3d.control定义的控件
    contextmenu: { hasDefault: true },
    mouseDownView: true,//鼠标滚轮缩放美化样式(指示图标)
    // zoom: { insertIndex: 1 },//放大缩小按钮
    // compass: { top: "10px", left: "5px" },//罗盘按钮
    distanceLegend: { left: "180px", bottom: "27px" }
  },
  // TODO:把基本会使用到的地图提前放入basemaps中，而后通过勾选的方式进行图层叠加和图层切换
  basemaps: [
    {
      name: "天地图影像(EPSG:4326)",
      icon: "//data.mars3d.cn/img/control/basemap/tdt_img.png",
      type: "group",
      layers: [
        {
          name: "底图",
          type: "tdt",
          layer: "img_d",
          crs: "EPSG:4326",
          key: mars3d.Token.tiandituArr
        },
        {
          name: "注记",
          type: "tdt",
          layer: "img_z",
          crs: "EPSG:4326",
          key: mars3d.Token.tiandituArr
        }
      ],
      credit: tdtCreditHtml,
      show: true
    },
    {
      name: "天地图电子(EPSG:4326)",
      icon: "//data.mars3d.cn/img/control/basemap/tdt_vec.png",
      type: "group",
      layers: [
        {
          name: "底图",
          type: "tdt",
          layer: "vec_d",
          crs: "EPSG:4326",
          key: mars3d.Token.tiandituArr
        },
        {
          name: "注记",
          type: "tdt",
          layer: "vec_z",
          crs: "EPSG:4326",
          key: mars3d.Token.tiandituArr
        }
      ],
      credit: tdtCreditHtml
    },
    {
      name: "天地图地形(EPSG:4326)",
      icon: "//data.mars3d.cn/img/control/basemap/tdt_ter.png",
      type: "group",
      layers: [
        {
          name: "底图",
          type: "tdt",
          layer: "ter_d",
          crs: "EPSG:4326",
          key: mars3d.Token.tiandituArr
        },
        {
          name: "注记",
          type: "tdt",
          layer: "ter_z",
          crs: "EPSG:4326",
          key: mars3d.Token.tiandituArr
        }
      ],
      credit: tdtCreditHtml
    },
    {
      name: "高德电子",
      icon: "//data.mars3d.cn/img/control/basemap/gaode_vec.png",
      type: "gaode",
      layer: "vec",
      credit: gdCreditHtml
    },
    {
      name: "高德影像",
      icon: "//data.mars3d.cn/img/control/basemap/gaode_img.png",
      type: "group",
      layers: [
        { name: "底图", type: "gaode", layer: "img_d" },
        { name: "注记", type: "gaode", layer: "img_z" }
      ],
      credit: gdCreditHtml
    }
  ]
}

